package com.gun.simpleFactory;

public class ComputerFactory {

    /**
     *
     * @param type 工厂策略模式
     * @return
     */
    public static Computer createComputer(String type){

        // 1、设置初始值
        Computer computer =null;

        // 2、策略模式
        switch (type){
            case "lenovo":
                computer = new LenovoComputer();
            case "hp":
                computer = new HpComputer();
        }

        // 3、返回一个电脑  [最终的结果]
        return  computer;
    }

}
